import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "../views/HomeView.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/home/inquiry/clinic-overview",
  },
  {
    path: "/home",
    name: "home",
    component: HomeView,
    children: [
      {
        path: "inquiry",
        redirect: "/home/inquiry/clinic-overview",
        component: () => import("../views/inquiry/InquiryView.vue"),
        children: [
          {
            path: "wait",
            component: () => import("../views/diagnostic/DiagnosticWait.vue"),
          },
          {
            path: "on",
            component: () => import("../views/diagnostic/DiagnosticOn.vue"),
          },
          {
            path: "finish",
            component: () => import("../views/diagnostic/DiagnosticFinish.vue"),
          },
          {
            path: "clinic-overview",
            component: () => import("../views/diagnostic/ClinicOverview.vue"),
          },
        ],
      },
      {
        path: "cloudMedical",
        component: () => import("../views/CloudMedical/CloudMedical.vue"),
      },
      {
        path: "patient",
        component: () => import("../views/patient/PatientView.vue"),
      },
      {
        path: "workbench",
        component: () => import("../views/workbench/Workbench.vue"),
      },
      {
        path: "knowledgeBase",
        component: () => import("../views/knowledgeBase/knowledgeBase.vue"),
      },
    ],
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
